export const mixins = {
  data() {
    return {
      zxinput: '',
      odinput: '',
      jdinput: '',
      sdinput: '',
      ldinput: '',
      ydinput:'',
      cameras: null,
      radio: 1,
      qustion:  [
],
      timer: null,
      tipfnshow: true,
      tzcwshow: false,
      choicemtshow: false,
      myshow: false,
      jcwtgshow: false,
      zcmtshow: false,
      jcsftgshow: false,
      chshow: true,
      csshow: true,
      smzshow: false,
      eccdshow: false,
      qdtzcsshow: false,
      erksshow: false,
      erksshowwc: false,
      smjxershow: false,
      zzshow: false,
      txllshow: false,
      questionshow: false,
      hdcshow: false,
      jcjilshow: false,
      ty6show: false,
      zc6show: false,
      kv: '120',
      mas: '220',
      jj: 'S0.0',
      qs: 'I17.500',
      sm: '4',
      ch: '5.041',
      sj: '1',
      js: 'S7.5',
      value1: false,
      ksshow: false,
      ksshowjx: false,
      hdstartshow: false,
      yzxshow: false,
      tbcdshow: false,
      hfsshow: false,
      hzjcshow: false,
      clanshow: false,
      clbgshow: false,
      roishow: false,
      hznumber: '',
      hzname: '',
      xjshow: false,
      gzshow: false,
      leftpx: -860,
      toppx: -37,
      topxs: 89,
      leftxt: 0,
      sx: 100,
      wztiptext: '',
      bztiptext: '',
      hzbhshow: false,
      mtjshow: false,
      mxshow: false,
      taskboxshow: true,
      czjshow: false,
      gjshow: true,
      mxmtnumber: '',
      loading: false,
      step: 1,
      steps: 1,
      taskdata: [],
      zc1show: false,
      zc2show: false,
      zc3show: false,
      zc4show: false,
      zc5show: false,
      ty1show: false,
      ty2show: false,
      ty3show: false,
      ty4show: false,
      ty5show: false,
      tipshow: false, //提示开关
      showmt1: false,
      showmt2: false,
      jxshow: false,
      ckshow :false,
      symt: '',
      lslpx: -13.5,
      allIds: ['CT1','CT2','CT3','CT4','CT5','CT6']
    };
        
    
  },

  created() { },
  mounted() { },
 

  methods: {
    visiblefn(id) { 
    
         
      this.allIds.forEach(item => {
        if (item == id) {
          this.$refs.seen[id].visible = true
        } else { 
          this.$refs.seen[item].visible = false
        }
            
          });
          if (this.$refs.seen.objects.length != 0) {
            this.$refs.seen.objects = []
            const timer = setTimeout(() => {
              this.$refs.seen.objects.push(this.$refs.seen[id])
              clearTimeout(timer)
            })
          } else {
            this.$refs.seen.objects.push(this.$refs.seen[id])
          }
    }
    ,
        tbfn() {
            this.tbcdshow = true
            this.$refs.tb.remove('fd')
        },
        tbcdfn() {
            this.tbcdshow = false
            this.yzxshow = true
            this.steps = 4
            this.$refs.tbcd1.classList.remove('bkys')
        },
        hfsfn() { 
            this.hzjcshow = true
              this.$refs.hfs.classList.remove('tm')
        },
            // 正在初始化
        hdstart() {
         this.$refs.hdqd.classList.remove('fd')
      this.hdstartshow = true
      setTimeout(() => {
        this.steps = 6
        this.ksshow = true
      }, 1000)
        },
        ksanfn() { 
            this.ksshowjx = true
            this.ksshow = false
            this.smzshow = true
            this.$refs.ksan.classList.remove('tm')
        },
        // tlpscffn() {
        //     // this.tlpshow = true
        //     this.tlpscf = false
        //      this.$refs.tlpscf.classList.remove('bkys')
        // },
      //   eccdsfn() {
      //            this.$refs.tlpscdaac.classList.remove('tm')
      // this.eccdshow = true
      // this.tlpscf = false
      // this.chshow = false
      // this.csshow = false
        
      // // this.tlpshow = false
                
                
      //   },
      smfn() { 
       
          this.$refs.smfn.classList.remove('bkys')
      },
      chfn() { 
        this.$refs.chfn.classList.remove('bkys')
      },
    tzxxfn() { 
      this.$refs.chfn.classList.remove('bkys')
      this.$refs.smfn.classList.remove('bkys')
      this.$refs.smfn.classList.remove('bkyss')
       this.$refs.chfn.classList.remove('bkyss')
          if (this.sm == 1 && this.ch == 10) {
            this.$refs.tzxxfn.classList.remove('fd')
            this.hdstartshow = true
            this.qdtzcsshow = false
            const timer = setTimeout(() => {
              this.hdstartshow = false
                      if (this.symt == 1) {
                     this.steps = 9}
            if (this.symt == 2) {
              this.steps = 10
            }
              clearTimeout(timer)
            }, 2000);
           
          } else { 
            if (this.ch != 10) { 
 this.$nextTick(() => { 
          
            this.$refs.chfn.classList.add('bkyss')
            })
            }
            if (this.ch == 10) { 
  this.$refs.chfn.classList.remove('bkyss')
            }
            if (this.sm != 1) { 
              this.$nextTick(() => { 
            
            this.$refs.smfn.classList.add('bkyss')
           
            })
            }
             if (this.sm == 1) { 
              this.$nextTick(() => { 
           
            this.$refs.smfn.classList.remove('bkyss')
           
            })
            }
           
            //  this.$refs.tzxxfn.classList.remove('fd')
            // 添加边框闪烁
          }
        },
        erksan() { 
            this.smjxershow = true
            this.erksshow = false
            this.zzshow = true
             this.$refs.erksan.classList.remove('tm')
            
        },
          // 扫描完成
        smwcfn() {
        this.$refs.smwcfn.classList.remove('fd')
      if (this.symt == 1) {
        this.steps = 11
      }
      if (this.symt == 2) {
        this.steps = 12
      }
        },
        qddcfn() { 
            this.$refs.qddcfn.classList.remove('fd')
          if (this.symt == 1) {
        this.steps = 11
      }
      if (this.symt == 2) {
        this.steps = 12
      }
        },
        clanfn() {
             this.$refs.clan.classList.remove('bkys')
      this.clanshow = false
      this.clbgshow = true
            this.txllshow = false
          this.zcmtshow = true
          
            
                this.timer = setTimeout(() => {
       this.questionshow = true
          // 在这里执行计时结束后的操作
             if (this.steps == 11) {
        this.qustion = [
          {
            id: 1, //题目id
            name: '单选题', //题目类型
            question: '水模测试正常CT值标准偏差范围应在', //题目名称
            options: [
              {
                id: 'A', //题目选项id
                name: 'A.1~7 HU之间' // 题目选项
              },
              {
                id: 'B',
                name: 'B.2~7 HU之间'
              },
              {
                id: 'C',
                name: 'C.3~7 HU之间'
              },
              {
                id: 'D',
                name: 'D.4~7 HU之间'
              },
              {
                id: 'E',
                name: 'E.5~7 HU之间'
              }
            ],
            answer: ['B'], //正确答案
            des: '' //答案解析表述
          },
          {
            id: 2, //题目id
            name: '单选题', //题目类型
            question: 'CT质控测试认为,理想的水模CT值应为', //题目名称
            options: [
              {
                id: 'A', //题目选项id
                name: 'A.±3 HU' // 题目选项
              },
              {
                id: 'B',
                name: 'B.-l000 HU'
              },
              {
                id: 'C',
                name: 'C.+1000 HU'
              },
              {
                id: 'D',
                name: 'D.0 HU'
              },
              {
                id: 'E',
                name: 'E.±5 HU'
              }
            ],
            answer: ['D'], //正确答案
            des: '' //答案解析表述
          },
          {
            id: 3, //题目id
            name: '单选题', //题目类型
            question: '水模平均CT值测试,水和空气CT值的正常波动范围是', //题目名称
            options: [
              {
                id: 'A', //题目选项id
                name: 'A.±5HU、±3HU' // 题目选项
              },
              {
                id: 'B',
                name: 'B.±3HU、±5HU'
              },
              {
                id: 'C',
                name: 'C.0HU、0HU'
              },
              {
                id: 'D',
                name: 'D.±3HU、±3HU'
              },
              {
                id: 'E',
                name: 'E.±5HU、±5HU'
              }
            ],
            answer: ['B'], //正确答案
            des: '' //答案解析表述
          }
        ]
      }
      if (this.steps == 12) {
        this.qustion = [
          {
            id: 1, //题目id
            name: '单选题', //题目类型
            question: '水模测试正常CT值标准偏差范围应在', //题目名称
            options: [
              {
                id: 'A', //题目选项id
                name: 'A.1~7 HU之间' // 题目选项
              },
              {
                id: 'B',
                name: 'B.2~7 HU之间'
              },
              {
                id: 'C',
                name: 'C.3~7 HU之间'
              },
              {
                id: 'D',
                name: 'D.4~7 HU之间'
              },
              {
                id: 'E',
                name: 'E.5~7 HU之间'
              }
            ],
            answer: ['B'], //正确答案
            des: '' //答案解析表述
          },
          {
            id: 2, //题目id
            name: '单选题', //题目类型
            question: 'CT质控测试认为,理想的水模CT值应为', //题目名称
            options: [
              {
                id: 'A', //题目选项id
                name: 'A.±3 HU' // 题目选项
              },
              {
                id: 'B',
                name: 'B.-l000 HU'
              },
              {
                id: 'C',
                name: 'C.+1000 HU'
              },
              {
                id: 'D',
                name: 'D.0 HU'
              },
              {
                id: 'E',
                name: 'E.±5 HU'
              }
            ],
            answer: ['D'], //正确答案
            des: '' //答案解析表述
          },
          {
            id: 3, //题目id
            name: '单选题', //题目类型
            question: '水模平均CT值测试,水和空气CT值的正常波动范围是', //题目名称
            options: [
              {
                id: 'A', //题目选项id
                name: 'A.±5HU、±3HU' // 题目选项
              },
              {
                id: 'B',
                name: 'B.±3HU、±5HU'
              },
              {
                id: 'C',
                name: 'C.0HU、0HU'
              },
              {
                id: 'D',
                name: 'D.±3HU、±3HU'
              },
              {
                id: 'E',
                name: 'E.±5HU、±5HU'
              }
            ],
            answer: ['B'], //正确答案
            des: '' //答案解析表述
          }
        ]
      }
          // 清除计时器，防止内存泄漏
          clearTimeout(this.timer)
        }, 2000)
     

 
        },
           // roi
        roifn() {
         this.$refs.roi.classList.remove('tm')
      this.roishow = false
      this.bztiptext =
        '在图像中心和图像圆周相当于钟表时针3、6、9、12时的方向做ROI'

      this.ty1show = true
      this.ty2show = true
      this.ty3show = true
      this.ty4show = true
      this.ty5show = true
      this.zcmtshow = true
        },
         focusfn() {
      this.$refs.hznb.classList.remove('bkys')
     
    },
    focusfns() {
      this.$refs.hznbs.classList.remove('bkys')
      
      },
      // hznbfn() { 
      //   if (this.hzname == 'CTtext' && this.hznumber == '123456') { 
      //     this.$refs.hznb.classList.remove('bkys')
      //     this.$refs.hznbs.classList.remove('bkys')
      //     this.steps==3
      //   }
      // },
      hznfn() { },
            // 重置
    // 重置步骤参数
      reset() {
        //  console.log('enabled',this.$refs.seen.action);
         if (this.$refs.seen&&this.$refs.seen.action!=null){ 
          this.$refs.seen.action.stop()
          }
       clearTimeout(this.timer)
      if (this.step == 4 && this.steps > 2) {
        // 去除css
        this.focusfn()
        this.focusfns()
        }
        if (this.step == 4 && this.steps == 2) {
        // 去除css
            this.$refs.hznb.classList.add('bkys')
             this.$refs.hznbs.classList.add('bkys')
        }
        this.ckshow = false
        this.jxshow = false
        this.tzwztrueshow =false
        this.hzbhshow = false
        this.jcjilshow = false
      this.yzxshow = false
      this.tbcdshow = false
      this.hfsshow = false
      this.showmt1 = false
      this.showmt2 = false
      this.txllshow = false
      this.clbgshow = false
      this.clanshow = false
      this.gjshow = true
      this.ksshowjx = false
      this.smzshow = false
      this.wztiptext = ''
      this.bztiptext = ''
      this.xjshow = false
      this.hzjcshow = false
      this.hdstartshow = false
      this.value1 = false
      this.ksshow = false
      this.eccdshow = false
      this.chshow = true
      this.csshow = true
      this.qdtzcsshow = false
      this.tlpscf = false
      this.erksshow = false
      this.erksshowwc = false
      this.smjxershow = false
      this.zzshow = false
      this.questionshow = false
      this.roishow = false
      this.zcmtshow = false
      this.zc1show = false
      this.zc2show = false
      this.zc3show = false
      this.zc4show = false
      this.zc5show = false
      this.ty1show = false
      this.ty2show = false
      this.ty3show = false
      this.ty4show = false
      this.ty5show = false
      this.jcsftgshow = false
      this.hdcshow = false
      this.jcwtgshow = false
      this.choicemtshow = false
        this.myshow = false
        this.czjshow = false
        this.tzcwshow = false
           this.ty6show= false
      this.zc6show= false
      },
      ty1fn() { 
        if (this.ty1show&&this.ty2show&&this.ty3show&&this.ty4show&&this.ty5show) { 
      
        this.zc1show = true
          this.ty1show = false
          this.$refs.ty1.classList.remove('tm')
       
         this.$nextTick(() => {
  // 在 DOM 更新后执行
   this.$refs.ty2.classList.add('tm')
         });
            this.tyfn()

        }
      },
        ty2fn() { 
        if (!this.ty1show&&this.ty2show&&this.ty3show&&this.ty4show&&this.ty5show) { 
           
        this.zc2show = true
          this.ty2show = false
          this.$refs.ty2.classList.remove('tm')
          
          this.$nextTick(() => { this.$refs.ty3.classList.add('tm') })
          this.tyfn()
        }
      },
         ty3fn() { 
        if (!this.ty1show&&!this.ty2show&&this.ty3show&&this.ty4show&&this.ty5show) { 
           
        this.zc3show = true
          this.ty3show = false
             this.$refs.ty3.classList.remove('tm')
         
          this.$nextTick(() => { this.$refs.ty4.classList.add('tm') })
          this.tyfn()
        }
      },
          ty4fn() { 
        if (!this.ty1show&&!this.ty2show&&!this.ty3show&&this.ty4show&&this.ty5show) { 
        
        this.zc4show = true
          this.ty4show = false
             this.$refs.ty4.classList.remove('tm')
        
          this.$nextTick(() => {
               this.$refs.ty5.classList.add('tm')
          })
             this.tyfn()
        }
      },
           ty5fn() { 
        if (!this.ty1show&&!this.ty2show&&!this.ty3show&&!this.ty4show&&this.ty5show) { 
          
         this.zc5show = true
          this.ty5show = false
          this.ty6show=true
          this.$refs.ty5.classList.remove('tm')
           this.$nextTick(() => {
               this.$refs.ty6.classList.add('tm')
          })
           this.tyfn()

             }
             
      },
           
               ty6fn() { 
        if (!this.ty1show&&!this.ty2show&&!this.ty3show&&!this.ty4show&&!this.ty5show&&this.ty6show) { 
           this.zc6show = true
         this.ty6show=false
          this.$refs.ty6.classList.remove('tm')
           this.tyfn()
          
          
        }
      },
      sfn() { 
        
        this.sx = this.sx + 1
        // this.topxs = this.toppx
        this.toppx = this.toppx - 1
           this.topxs = -(this.toppx+37)+63
      },
      xfn() { 
        this.toppx = this.toppx + 1
        this.topxs = -(this.toppx+37)+63
        this.sx = this.sx - 1
      },
      hfn() { 
      
        // this.leftxt = this.leftpx 
        if (this.steps == 2 && this.step == 3) { 
  if (this.leftpx + 860 > 0) { 
            this.leftpx = this.leftpx - 10
        }
          this.leftxt = ((this.leftpx + 860) * 1.2432).toFixed(0)
          this.$refs.y.classList.remove('tm')
          this.$refs.z.classList.remove('tm')
        }
      },
      qfn() { 
        // this.lslpx = 10
        if (this.steps == 2 && this.step == 3) { 
          if (((this.leftpx + 860) * 1.2432).toFixed(0) <= 1082) { 
             this.leftpx = this.leftpx + 10
          this.leftxt = ((this.leftpx + 860 ) *1.2432 ).toFixed(0)
          this.$refs.z.classList.remove('tm')
          this.$refs.y.classList.remove('tm')
          }
       
        }
        
        
          // this.leftxt = this.leftpx 1082
      },
      tzqdf() { 
        if (this.steps == 2 && this.step == 3) { 
        // const dd = (this.leftpx+860)* 1.2432.toFixed(0)
          // console.log('dd',dd);
          if (((this.leftpx + 860) * 1.2432).toFixed(0) == 460) {
            this.step = 4
          } else {
            this.flag += 1
            console.log('回答错误', ((this.leftpx + 860) * 1.2432).toFixed(0));
           
            
            if (this.flag <= 4) {
              this.tzcwshow = true
              const tme = setTimeout(() => {
                this.tzcwshow = false
                clearTimeout(tme)
              }, 2000)
            } else { 
              console.log('正确答案');
              this.tzwztrueshow = true
            }
        }
        }
      },
      jgfn() { 
        this.steps = 2
        this.$refs.jg.classList.remove('tm')
      },
      xjyz() { 
        const timer = setTimeout(() => { 
          if (this.hzname != 'CTtext') {
          
            this.$nextTick(() => { 
            this.$refs.hznb.classList.add('bkys')
            })
        }
        if (this.hznumber != '123456') {
          this.$nextTick(() => { 
             this.$refs.hznbs.classList.add('bkys')
          })
      }
        }, 1000)
       
        
        clearTimeout(timer)
    },
    jlfn() { 
      if (this.symt == 1) { 
        if (this.zxinput == -0.23 &&
          this.odinput == -0.37 &&
          this.jdinput == -0.63 &&
          this.sdinput == -0.39 &&
          this.ldinput == -0.34 &&
          this.ydinput == -0.4) {
          this.bztiptext = '回答正确请点击继续按钮'
          const timer = setTimeout(() => {
            this.jxshow = true
            clearTimeout(
              timer
            )
            
          }, 1);
        } else { 
         
          this.bztiptext = '回答错误请点击查看按钮， 查看更正后的正确答案'
         
           const timer = setTimeout(() => {
            this.ckshow = true
            clearTimeout(
              timer
            )
            
          }, 1);
        }
        
      }
        if (this.symt == 2) { 
        if (this.zxinput == 1.16 &&
          this.odinput == -13.47&&
          this.jdinput == 1.53 &&
          this.sdinput == 0.84 &&
          this.ldinput == 0.52 &&
          this.ydinput ==-14.63) {
          this.bztiptext = '回答正确请点击继续按钮'
          const timer = setTimeout(() => {
            this.jxshow = true
            clearTimeout(
              timer
            )
            
          }, 1);
        } else { 
         
          this.bztiptext = '回答错误请点击查看按钮， 查看更正后的正确答案'
         
           const timer = setTimeout(() => {
            this.ckshow = true
            clearTimeout(
              timer
            )
            
          }, 1);
        }
        
      }
    },
    ckfn() { 
      
      if (this.symt == 1) {   this.zxinput = -0.23
        this.odinput = -0.37 
        this.jdinput = -0.63 
          this.sdinput = -0.39 
          this.ldinput = -0.34 
          this.ydinput = -0.4}
      if (this.symt == 2) { 
       this.zxinput = 1.16 
          this.odinput = -13.47
          this.jdinput = 1.53 
          this.sdinput = 0.84 
          this.ldinput = 0.52 
          this.ydinput =-14.63
      }
      this.bztiptext = '请点击继续按钮'
      this.ckshow = false
      this.jxshow = true
    },
  
}
    
};